//delete//
const Utils = require("../util/utils")
const statusCode = require('../util/status-code')
const getCommonTemplateList = require("../mock/server/getCommonTemplateList");
const getTemplateDetail = require("../mock/server/getTemplateDetail");

//delete//
class BuryPointTemplateController {
    /**
     * 创建信息
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async create(ctx) {
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('创建成功', '')
        
    }

    /**
     * 更新
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async update(ctx) {
        let req = JSON.parse(ctx.request.body);
        let id = req.id;
        if (req) {
            ctx.response.status = 200;
            ctx.body = statusCode.SUCCESS_200('更新信息成功！', '');
        } else {
            ctx.response.status = 412;
            ctx.body = statusCode.ERROR_412('更新信息失败！')
        }
    }

    /**
     * 复制
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async copy(ctx) {
        let req = JSON.parse(ctx.request.body);
        let id = req.id;
        if (req) {
            ctx.response.status = 200;
            ctx.body = statusCode.SUCCESS_200('更新信息成功！', '');
        } else {
            ctx.response.status = 412;
            ctx.body = statusCode.ERROR_412('更新信息失败！')
        }
    }

    /**
     * 删除
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async delete(ctx) {
        let param = JSON.parse(ctx.request.body);
        const { id } = param
        // 删除前，先检查是否还有
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', "")
    }
    
    /**
     * 批量删除
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async deleteBatch(ctx) {
        let param = JSON.parse(ctx.request.body);
        const { id } = param
        // 删除前，先检查是否还有
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', "")
    }
    
    /**
     * 创建项目
     * @param ctx
     * @returns {Promise.<void>}
     */
    static async createProject(ctx) {
        let param = JSON.parse(ctx.request.body);
        const { id } = param
        // 删除前，先检查是否还有
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', "")
    }

     /**
     * 获取详情
     * @param {*} ctx 
     */
     static async detail(ctx){
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('查询详情成功！', getTemplateDetail)
        
    }

    /**
     * page
     * @param 
     * 
     */
    static async getCommonTemplatePageList(ctx) {
        let req = ctx.request.body
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', getCommonTemplateList)
    }

    /**
     * page
     * @param 
     * 
     */
    static async getMyTemplatePageList(ctx) {
        let req = ctx.request.body
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', getCommonTemplateList)
    }
    
    /**
     * page
     * @param 
     * 
     */
    static async getSysTemplatePageList(ctx) {
        let req = ctx.request.body
        ctx.response.status = 200;
        ctx.body = statusCode.SUCCESS_200('success', getSdkPageList)
    }
}
//exports//
module.exports = BuryPointTemplateController
//exports//